<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">-->
    <script type="text/javascript" charset="utf-8" src="/static/lib/plug/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/lib/plug/ueditor/ueditor.all.min.js"></script>

    {% include 'public_css.html' %}

</head>

<body>

{% include 'myblogs/public_topbar.html' %}

<div class="am-g" align='center'>

</div>
<hr>
<div class="am-g" align="center">
    <div class="am-u-md-12">
        <form class="am-form am-form-horizontal" id="blogcontent_form" enctype="multipart/form-data" method="POST"
              action="">
            <div class="am-form-group" align="left">
                <label class="am-u-md-2 am-form-label">博客题目:</label>

                <div class="am-u-md-10">
                    <input type="text" id="blog_title" name="blog_title">
                </div>
            </div>
            <!--

            -->
            <div class="am-form-group" align="left">
                <label class="am-u-sm-2 am-form-label">标签分类:</label>
                <!--
                 <input type="text" id="blog_tags_input" name="blog_tags_input">
                  -->
                <div class="am-u-sm-10">
                    <select id="blog_tags_select" name="blog_tags_select">
                        {% for type in obj.type_dict %}
                            <option value="{{ type }}">{{ type }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>

            <div class="am-form-group" align="left">
                <label class="am-u-md-2 am-form-label">导读:</label>

                <div class="am-u-md-10">
                    <input type="text" id="blog_preview" name="blog_preview" placeholder="少于200字">
                </div>
            </div>


            <div class="am-form-group">
                <label for="blog_content" class="am-u-sm-2 am-form-label">正文:</label>

                <div class="am-u-sm-10">

                    <textarea id="blog_content" name="blog_content" placeholder="正文"></textarea>

                </div>
            </div>

            <div class="am-form-group" align="center">
                <div>
                    <input type="file" id="blog_pic" name="blog_pic" class="am-btn am-btn-primary">
                </div>
            </div>

            <div class="am-form-group" align="center">
                <div>
                    <button type="submit" class="am-btn am-btn-primary">提交</button>

                    <button type="button" onclick="location.reload();" class="am-btn am-btn-success">放弃</button>
                </div>
            </div>

            {% csrf_token %}
        </form>


    </div>
</div>
<!-- UE script -->
<script>
    var ue = UE.getEditor("blog_content");
    function submitForm() {
        //alert(ue.getAllHtml());
        $("#blogcontent_form").submit()
    }
</script>

<!-- UE script end-->
{% include 'public_footer.html' %}
</body>

</html>